package com.itheima.homework.test1;

/**
 * @author jiangxun
 * @date 11-19-2024
 */
public class GoldCard extends Card{
    public GoldCard(String id, double balance) {
        super(id, balance);
    }
    @Override
    public void pay(double amount) {
        double discountedAmount = amount * 0.8;
        if(discountedAmount<=getBalance()){
            System.out.println("使用金卡支付,按照原来8折计算输出");
        }else{
            System.out.println("余额不足");
        }
    }
}
